import request from '@/utils/request';

// 列表接口
export async function getRemitPageList(params) {
  return request(`/csApi/clmPay/remiList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function getClaimPageList(params) {
  return request(`/csApi/clmPay/pageClmRcrdList`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getUpdateList(params, claimTypeId, radioValue) {
  //  客服： 1.客户 2.供应商 3.员工 运行：4（社保、公积金） 全国：5.接单方 6.签约方
  let url;
  switch (Number(claimTypeId)) {
    case 1:
      url = radioValue ? `/csApi/csBill/getClmList` : `/csApi/onceCust/clmCustList`;
      break;
    case 2:
      url = radioValue ? `/csApi/nsBill/getClmList` : `/csApi/onceSupp/clmSuppList`;
      break;
    case 3:
      url = `/csApi/onceEmp/clmEmpList`;
      break;
    case 4:
      url = radioValue
        ? `/esApi/insRefundInfo/pageListClaimInsRefundInfo`
        : `/osApi/accuRefundInfo/pageListClaimAccuRefundInfo`;
      break;
    case 5:
      url = `/esApi/insRefundInfo/pageListClaimInsRefundInfo`; // dataType:2
      break;
    case 6:
      url = radioValue ? `/nsApi/nsBillChrg/getClmList` : `/nsApi/onceChrg/queryClmChrgPage`;
      break;
    default:
      break;
  }
  return request(url, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function getRemitDetail(params) {
  return request(`/csApi/clmPay/getRemit`, {
    method: 'POST',
    body: params,
  });
}
export async function getClaimDetail(params) {
  return request(`/csApi/clmPay/getRcrd`, {
    method: 'POST',
    body: params,
  });
}
export async function getClaimCancel(params) {
  return request(`/csApi/clmPay/cancelRemit`, {
    method: 'POST',
    body: params,
  });
}
export async function getProcessInfor(params) {
  return request(`/csApi/clmPay/getProcess`, {
    method: 'POST',
    body: params,
  });
}
export async function getClmAdjustBill(params) {
  //  客服： 1.客户 2.供应商 3.员工 运行：4（社保、公积金） 全国：5.接单方 6.签约方
  let url;
  switch (Number(params.clmType)) {
    case 1:
      url = Number(params.feeType) === 1 && `/csApi/csBill/getByWhereBill`;
      break;
    case 2:
      url = Number(params.feeType) === 1 && `/csApi/nsBill/getByWhereBill`;
      break;
    case 6:
      url = Number(params.feeType) === 1 && `/nsApi/nsBillChrg/getByWhereBill`; // dataType:2
      break;
    default:
      break;
  }
  return request(url, {
    method: 'POST',
    body: params,
  });
}

export async function getInsert(params) {
  return request(`/csApi/clmPay/insertRemit`, {
    method: 'POST',
    body: params,
  });
}
export async function getBalanceAval(params) {
  return request(`/csApi/clmPay/getBalanceAval`, {
    method: 'POST',
    body: params,
  });
}
export async function getQueryBusiParam(params) {
  return request(`/mgrApi/busiParamMGR/queryBusiParam`, {
    method: 'POST',
    body: params,
  });
}
export async function getSupplyList(params) {
  return request(`/csApi/supplier/contSuppList`, {
    method: 'POST',
    body: params,
  });
}
